<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="DIY">
    <link rel="shortcut icon" href="__ADMIN__/img/favicon.png">

    <title>KADMIN后台管理</title>

    <!-- Bootstrap core CSS -->
    <link href="__ADMIN__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__ADMIN__/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="__ADMIN__/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!--toastr-->
    <link href="__ADMIN__/assets/toastr-master/toastr.css" rel="stylesheet" type="text/css" />

    <!-- 模版CSS -->
    <link href="__ADMIN__/css/style.css" rel="stylesheet">
    <link href="__ADMIN__/css/style-responsive.css" rel="stylesheet" />
    <block name="style"></block>
    <!--[if lt IE 9]>
    <script src="__ADMIN__/js/html5shiv.js"></script>
    <script src="__ADMIN__/js/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<section id="container" >
    <!--载入HEAD-->
    <include file="Public/head" />

    <aside>
        <!--载入LEFT-->
        <include file="Public/left" />
    </aside>
    <!--sidebar end-->
    <!--内容开始-->
    <section id="main-content">
        <block name="content"></block>
    </section>
    <!--内容结束-->


    <!--载入footer文件-->
    <include file="Public/footer" />

</section>

<!-- 通用JS -->
<script type="text/javascript" src="__ADMIN__/js/jquery.js"></script>
<script type="text/javascript" src="__ADMIN__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.dcjqaccordion.2.7.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.scrollTo.min.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.nicescroll.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.customSelect.min.js" ></script>
<script type="text/javascript" src="__ADMIN__/js/respond.min.js" ></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.form.min.js"></script>
<script type="text/javascript" src="__ADMIN__/assets/toastr-master/toastr.js"></script>
<!--通用JS-->
<script type="text/javascript" src="__ADMIN__/js/common-scripts.js"></script>
<script>
    //通用表单提交
    $('.ajax-from-submit').ajaxForm({
        //验证数据
        beforeSubmit:function(){
            $('.ajax-from-submit .ajax-form-btn').text('提交中...');
        },
        dataType: 'json',
        success:function(data){
            $('.ajax-from-submit .ajax-form-btn').text('提交');
            if(data.status==1){
                toastr.success(data.info, "操作通知");
                if(data.url){
                    setTimeout("window.location.href ='" + data.url + "'",1500);
                }
            }
            else{
                toastr.error(data.info, "操作通知");
                if(data.url){
                    setTimeout("window.location.href ='" + data.url + "'",1500);
                }
            }
        }
    });

    /*
     通用AJAX访问
    * ajax-url ajax提交的URL
    * ajax-msg ajax弹出消息框
    * */
    $('.ajax-action-btn').click(function(){
        var url = $(this).attr('ajax-url');
        var msg = $(this).attr('ajax-msg');
        if(msg){
            if(!confirm(msg)){
                return false;
            }
        }
        $.ajax({
            url: url,
            async:false,
            success: function(data){
                if(data.status==1){
                    toastr.success(data.info, "操作通知");
                    if(data.url){
                        setTimeout("window.location.href ='" + data.url + "'",1500);
                    }
                }
                else{
                    toastr.error(data.info, "操作通知");
                    if(data.url){
                        setTimeout("window.location.href ='" + data.url + "'",1500);
                    }
                }
            }
        });
    });

    /*
    * 菜单高亮显示
    * */
    function MenuHighlight(URL){
        var menu = $("#nav-accordion").find("a[href='"+URL+"']");
        var len = menu.parent("li").parent("ul").prev("a").length;
        if(len>0){
            menu.parent("li").addClass('active').parent("ul").show().prev("a").addClass('active');
        }
        else{
            menu.addClass('active');
        }
    }
</script>
<block name="javascript"></block>
</body>
</html>
